package bigdata;

import java.io.IOException;

import com.hazelcast.nio.serialization.Portable;
import com.hazelcast.nio.serialization.PortableReader;
import com.hazelcast.nio.serialization.PortableWriter;

public class Rule implements Portable {

	private int tel;
	private boolean isBlack;
	private boolean isWhite;

	public int getTel() {
		return tel;
	}

	public void setTel(int tel) {
		this.tel = tel;
	}

	public boolean isBlack() {
		return isBlack;
	}

	public void setBlack(boolean isBlack) {
		this.isBlack = isBlack;
	}

	public boolean isWhite() {
		return isWhite;
	}

	public void setWhite(boolean isWhite) {
		this.isWhite = isWhite;
	}

	public Rule(int tel, boolean isBlack, boolean isWhite) {
		super();
		this.tel = tel;
		this.isBlack = isBlack;
		this.isWhite = isWhite;
	}

	public Rule() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public int getFactoryId() {
		return 1;
	}

	@Override
	public int getClassId() {
		return 1;
	}

	@Override
	public void writePortable(PortableWriter writer) throws IOException {
		writer.writeInt("tel", tel);
		writer.writeBoolean("isBlack", isBlack);
		writer.writeBoolean("isWhite", isWhite);
	}

	@Override
	public void readPortable(PortableReader reader) throws IOException {
		tel = reader.readInt("tel");
		isBlack = reader.readBoolean("isBlack");
		isWhite = reader.readBoolean("isWhite");
	}

}
